package com.k.sshm.boot.cloud.dubbo.server.impl;

import com.k.dep.common.util.NetworkUtils;
import com.k.rpc.dubbo.anno.api.model.Person;
import com.k.rpc.dubbo.anno.api.service.group.TestRegistryGroupService;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.PreDestroy;
import java.util.List;

@DubboService(version = "1")
//(group = "aa", connections = 10,loadbalance = "leastactive")
public class TestRegistryGroupServiceImpl1 implements TestRegistryGroupService {
    @Override
    public List<String> helloGroup1(String name) {
        return List.of(NetworkUtils.getHostIP() + name);
    }

    @Override
    public List<String> helloGroup2(Person persion) {
        return List.of(NetworkUtils.getHostIP() + persion.toString());
    }

    @PreDestroy
    public void des() throws InterruptedException {
        Thread.sleep(100000);
    }
}
